This C# code has a k-max of 14 hard-coded.